package com.cndw.kungfu.model.pvp.campcross;

import java.util.Comparator;

public class CampCrossWinComparator implements Comparator<CampTeam> {

	@Override
	public int compare(CampTeam o1, CampTeam o2) {
		int diff = o2.getWin() - o1.getWin();
		if (diff == 0) {
			diff = o2.getStreak() - o1.getStreak();
			if (diff == 0) {
				diff = o2.getPower() - o1.getPower();
				if (diff == 0) {
					if (o2.getMasterId() > o1.getMasterId()) {
						diff = 1;
					} else {
						diff = -1;
					}
				}
			}
		}
		return diff;
	}

}
